// model/Hall.java
package main.java.com.cinema.model;

import java.io.Serializable;

public class Hall implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String name;
    private int rows;
    private int seatsPerRow;

    public Hall() {
        System.out.println("DEBUG: 创建空Hall对象");
    }

    public Hall(String id, String name, int rows, int seatsPerRow) {
        System.out.println("DEBUG: 创建Hall对象 - ID: " + id + ", 名称: " + name);
        this.id = id;
        this.name = name;
        this.rows = rows;
        this.seatsPerRow = seatsPerRow;
        System.out.println("DEBUG: Hall对象创建完成 - " + name);
    }

    // Getters and Setters
    public String getId() {
        System.out.println("DEBUG: 获取Hall ID: " + id);
        return id;
    }
    public void setId(String id) {
        System.out.println("DEBUG: 设置Hall ID: " + id);
        this.id = id;
    }

    public String getName() {
        System.out.println("DEBUG: 获取Hall名称: " + name);
        return name;
    }
    public void setName(String name) {
        System.out.println("DEBUG: 设置Hall名称: " + name);
        this.name = name;
    }

    public int getRows() {
        System.out.println("DEBUG: 获取Hall行数: " + rows);
        return rows;
    }
    public void setRows(int rows) {
        System.out.println("DEBUG: 设置Hall行数: " + rows);
        this.rows = rows;
    }

    public int getSeatsPerRow() {
        System.out.println("DEBUG: 获取Hall每行座位数: " + seatsPerRow);
        return seatsPerRow;
    }
    public void setSeatsPerRow(int seatsPerRow) {
        System.out.println("DEBUG: 设置Hall每行座位数: " + seatsPerRow);
        this.seatsPerRow = seatsPerRow;
    }

    public int getTotalSeats() {
        int total = rows * seatsPerRow;
        System.out.println("DEBUG: 计算总座位数: " + rows + "×" + seatsPerRow + "=" + total);
        return total;
    }
}
